Optimal. Leaf size=64 \[ \frac{b^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{a^{3/2} f (a-b)}-\frac{x}{a-b}-\frac{\cot (e+f x)}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11064, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3670, 480, 522, 203, 205} \[ \frac{b^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{a^{3/2} f (a-b)}-\frac{x}{a-b}-\frac{\cot (e+f x)}{a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 480
Rule 522
Rule 203
Rule 205
Rubi steps
\begin{align*} \int \frac{\cot ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^2 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{\cot (e+f x)}{a f}+\frac{\operatorname{Subst}\left (\int \frac{-a-b-b x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{a f}\\ &=-\frac{\cot (e+f x)}{a f}-\frac{\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f}+\frac{b^2 \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{a (a-b) f}\\ &=-\frac{x}{a-b}+\frac{b^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{a^{3/2} (a-b) f}-\frac{\cot (e+f x)}{a f}\\ \end{align*}
Mathematica [A] time = 0.23702, size = 68, normalized size = 1.06 \[ \frac{b^{3/2} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )-\sqrt{a} ((a-b) \cot (e+f x)+a (e+f x))}{a^{3/2} f (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.067, size = 73, normalized size = 1.1 \begin{align*} -{\frac{1}{fa\tan \left ( fx+e \right ) }}+{\frac{{b}^{2}}{fa \left ( a-b \right ) }\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f \left ( a-b \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.17911, size = 568, normalized size = 8.88 \begin{align*} \left [-\frac{4 \, a f x \tan \left (f x + e\right ) + b \sqrt{-\frac{b}{a}} \log \left (\frac{b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} - 4 \,{\left (a b \tan \left (f x + e\right )^{3} - a^{2} \tan \left (f x + e\right )\right )} \sqrt{-\frac{b}{a}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right ) \tan \left (f x + e\right ) + 4 \, a - 4 \, b}{4 \,{\left (a^{2} - a b\right )} f \tan \left (f x + e\right )}, -\frac{2 \, a f x \tan \left (f x + e\right ) - b \sqrt{\frac{b}{a}} \arctan \left (\frac{{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt{\frac{b}{a}}}{2 \, b \tan \left (f x + e\right )}\right ) \tan \left (f x + e\right ) + 2 \, a - 2 \, b}{2 \,{\left (a^{2} - a b\right )} f \tan \left (f x + e\right )}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 22.1719, size = 570, normalized size = 8.91 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.44382, size = 390, normalized size = 6.09 \begin{align*} \frac{\frac{{\left (a^{2} b + a b^{2} - b{\left | -a^{2} + a b \right |}\right )}{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{2 \, \tan \left (f x + e\right )}{\sqrt{\frac{2 \, a^{2} + 2 \, a b + \sqrt{-16 \, a^{3} b + 4 \,{\left (a^{2} + a b\right )}^{2}}}{a b}}}\right )\right )}}{a^{2}{\left | -a^{2} + a b \right |} + a b{\left | -a^{2} + a b \right |} +{\left (a^{2} - a b\right )}^{2}} + \frac{{\left ({\left (a^{2} + a b\right )} \sqrt{a b}{\left | b \right |} + \sqrt{a b}{\left | -a^{2} + a b \right |}{\left | b \right |}\right )}{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{2 \, \tan \left (f x + e\right )}{\sqrt{\frac{2 \, a^{2} + 2 \, a b - \sqrt{-16 \, a^{3} b + 4 \,{\left (a^{2} + a b\right )}^{2}}}{a b}}}\right )\right )}}{{\left (a^{2} - a b\right )}^{2} b -{\left (a^{2} b + a b^{2}\right )}{\left | -a^{2} + a b \right |}} - \frac{1}{a \tan \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]